package com.kun.portal.webframe.controller;
/**
 * 车辆派遣管理
 */

import com.kun.portal.webframe.po.AppointmentPo;
import com.kun.portal.webframe.po.RoomPo;
import com.kun.portal.webframe.po.VehicleDispatchPo;
import com.kun.portal.webframe.service.AppointmentService;
import com.kun.portal.webframe.service.VehicleDispatchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;
import java.util.List;

/**
 * Created by Administrator on 2018/5/10.
 */
@Controller
@RequestMapping({"/api/vehicle"})
public class VehicleDispatchController {
    @Autowired
    private VehicleDispatchService vehicleDispatchService;

    @Autowired
    private AppointmentService appointmentService;
    @RequestMapping(
            value = {"/saveVehicle"},
            method = {RequestMethod.POST},
            produces = {"application/json"}
    )
    @ResponseBody
    public void saveVehicle(@RequestBody AppointmentPo appointmentPo) {
        VehicleDispatchPo vehicleDispatchPo1 = vehicleDispatchService.saveVehicleDispatchPo(appointmentPo.getVehicleDispatch());
        appointmentPo.setVehicleDispatch(vehicleDispatchPo1);
        appointmentPo.setIsDispatch("已派发");
        appointmentService.editAppointment(appointmentPo);
    }

}

